import { Component, OnInit, Input } from '@angular/core';
import { UserService } from 'src/app/service/user.service';
import { YearawardService } from '../yearaward.service';
import { BaseService } from 'src/app/service/base.service';
import { UtilsService } from 'src/app/service/utils.service';
@Component({
  selector: 'app-welfare',
  templateUrl: './index.component.html',
  styleUrls: ['./index.component.scss'],
})
export class WelfareComponent implements OnInit {
  @Input() timeConfig: any[] = [];
  /* ___ _ ___ */
  public deployUrl: string; /* 资源地址前缀 */
  /* ___ _ ___ */
  public isPC = false; /* 是否pc */
  public isAndroid = false; /* 是否安卓 */
  public onRefrash = false; /* 刷新中 */
  public tabs: number[] = [1, 2, 3]; /* tabs */
  /* ___ _ ___ */
  public curTab = 1; /* 当前tab 1签到福利 2主播福利 3用户福利 */

  constructor(
    private userService: UserService,
    private yearawardService: YearawardService,
    private baseService: BaseService,
    private utilsservice: UtilsService
  ) {}

  ngOnInit(): void {
    // 获取
    this.deployUrl = this.userService.getDeployUrl();
    this.isPC = this.userService.getIsPc();
    this.isAndroid = this.utilsservice.getBrowserVersion();
  }

  /**
   * @param tab 当前tab
   * @description: 切换tab
   */
  onTabClick(tab) {
    this.curTab = tab;
  }
}
